home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT6 / DETPC.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  1.9 KB  |  48 lines

  1.  
  2. ;
  3. ;       Program DetPC ( Chapter 6 )
  4. ;
  5. page 55,132
  6. .model large
  7.  
  8. HiBios  segment at 0F000h
  9.          org            0FFFEh
  10. PcType  db      ?               ; Computer idenifier
  11. HiBios  ends
  12.  
  13. .code
  14.         assume es:HiBios        ; ES wil be used for accessing ROM BIOS area
  15. Begin:  mov     ax,@data        ; load segment address of DATA segement
  16.         mov     ds,ax           ; DS points to DATA segment
  17.         mov     ax,HiBios       ; load segment address or ROM BIOS data
  18.         mov     es,ax           ; ES points to ROM BIOS segment
  19.         mov     cx,Ltable       ; Load length of table to be searched
  20.         mov     dl,PcType       ; Extract the type from BIOS area
  21.  
  22. Search: mov     bx,cx           ; Address of current table element
  23.         cmp     dl,TypeTbl[bx-1] ;Compare type and element of table
  24.         je      EndSear         ; If found, stop searching
  25.         loop    Search          ; Test next element of table
  26.  
  27. EndSear:mov     al,cl           ; number element found passed as return code
  28.         mov     ah,4Ch          ; DOS service 4H - terminate process
  29.         int     21h             ; DOS service call
  30. .data                           ;
  31.  
  32. ;       Table of microprocessors' types
  33.  
  34.         db      0               ;  0 - Uknown type
  35. TypeTbl db      0F8h            ;  1 - IBM PS/2 model 80
  36.         db      0F9h            ;  2 - IBM PC Convertible
  37.         db      0FAh            ;  3 - IBM PS/2 Model 30
  38.         db      0FBh            ;  4 - PC XT Ext keyboard, 3.5" drives
  39.         db      0FCh            ;  5 - PC-AT or PS/2 Models 50,60
  40.         db      0FDh            ;  6 - IBM PC-JR
  41.         db      0FEh            ;  7 - PC-XT
  42.         db      0FFh            ;  8 - IBM PC
  43.         db      09Ah            ;  9 - Compaq XT / Compaq Plus
  44.         db      030h            ; 10 - Sperry PC
  45.         db      02Dh            ; 11 - Compaq PC / Compaq Deskpro
  46. Ltable  equ     $-TypeTbl
  47.         end     begin
  48.